#!/usr/bin/env bash
# bash <(curl -sLk https://gitee.com/uon/script/raw/master/shell/libstdc++/libstdc++.sh)

var_dir="/tmp/a3ff9b51-d73f-8b75-a27d-be3e2a66a360"
[ ! -d "${var_dir}" ] && mkdir "${var_dir}"

function install() {
    curl -fLOk --retry 3 "https://gitee.com/uon/script/raw/master/shell/libstdc++/libstdc++.so.6"

    if [ ! -f "/lib/libstdc++.so.6" ]; then
        cp libstdc++.so.6 /lib/libstdc++.so.6
    else
        echo enable
    fi
}

cd "${var_dir}" && install && rm -rf "${var_dir}"